/**
 * Created by baishuai on 2017/12/11.
 */
// JavaScript Document
$(document).ready(function(){
    //棣栭〉璁捐妗堜緥
    $(".casesBox .img").hover(function(){
        var width = $(this).width();
        height =$(this).height();
        var i = Math.floor(Math.random()*4+1);
        var $dom = $(this).find(".hover");
        $dom.stop(true,true);
        switch(i){
            case 1:	$dom.css({'top':'-'+height,'left':'0px'}).attr({'_top':'-'+height,'_left':'0px'}).animate({'top':'0px','left':'0px'},10);break;
            case 2:	$dom.css({'top':height,'left':'0px'}).attr({'_top':height,'_left':'0px'}).animate({'top':'0px','left':'0px'},10);break;
            case 3:	$dom.css({'top':'0px','left':'-'+width}).attr({'_top':'0px','_left':'-'+width}).animate({'top':'0px','left':'0px'},10);break;
            case 4:	$dom.css({'top':'0px','left':width}).attr({'_top':'0px','_left':width}).animate({'top':'0px','left':'0px'},10);break;
        }
    },function(){
        var $dom = $(this).find(".hover");
        $dom.stop(true,true);
        var _top = $dom.attr('_top');
        var _left = $dom.attr('_left');
        $dom.animate({'top':_top,'left':_left},10);
    });
    $(".iBrand img").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});
});
$(function(){
    $('#iTeamBox>ul').roundabout({
        minOpacity:1,
        btnNext: ".next",
        duration: 1000,
        reflect: true,
        btnPrev: '.prev',
        autoplay:true,
        autoplayDuration:5000,
        minScale: 0.6,
        maxScale: 1.0,
        shape: 'figure8'
    });
});